package util.filefilter;

import java.io.File;
import java.io.FileFilter;

/**
 *
 * @author Quân
 */
public class ImageFileFilter implements FileFilter {

    private final String[] extensions =
            new String[]{"jpg", "png", "gif", "jpeg"};

    @Override
    public boolean accept(File file) {
        for (String extension : extensions) {
            if (file.getName().toLowerCase().endsWith(extension)) {
                return true;
            }
        }
        return false;
    }
}